You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TOpenCLMtxVec Class > TOpenCLMtxVec Methods > CartToPolar Method > TOpenCLMtxVec.CartToPolar Method ([In] TOpenCLMtxVec, [In] TOpenCLMtxVec)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TOpenCLMtxVec.CartToPolar Method ([In] TOpenCLMtxVec, [In] TOpenCLMtxVec)

Converts elements from cartesian to polar coordinate form.

Syntax
C#
Visual Basic
public void CartToPolar([In] TOpenCLMtxVec AmpltVec, [In] TOpenCLMtxVec PhaseVec);

Converts all calling object elements from cartesian to polar coordinate form, storing the magnitude (radius) component of corresponding elements in the AmpltVec and the phase (angle) component of corresponding elements in the PhaseVec. If you want to use this method then the calling matrix TOpenCLBase.ComplexComplexproperty must be true. If this is not the case, an exception is raised. Size and TOpenCLBase.ComplexComplexproperties of AmpltVec and PhaseVec are set automatically.

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { TOpenCLMatrix A, Ampl, Phase; clMtxVec.CreateIt(out A, out Ampl, out Phase); try { a.SetIt(2, 2, true, new double[] {1,0, 2,0, 2,0, 4,1}); A.CartToPolar(Amplt, Phasw); } finally { clMtxVec.FreeIt(ref A, ref Amplt, ref Phase); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!